<template name="closeRoom">
	<section class="create-channel">
		<div class="create-channel__wrapper">
			<p class="create-channel__description">{{_ "Close_room_description"}}</p>
			<form id="close-room" class="close-room__content">
				<div class="create-channel__inputs">
					<div class="rc-input {{#if invalidComment}}rc-input--error{{/if}}">
						<label class="rc-input__label">
							<div class="rc-input__wrapper">
								<input name="comment" id="comment" type="text" class="rc-input__element"
									   placeholder="{{_ "Please_add_a_comment"}}" autofocus>
							</div>
						</label>
						{{#if invalidComment}}
						<div class="rc-input__error">
							<div class="rc-input__error-icon">
								{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
							</div>
							<div class="rc-input__error-message">{{_ "Please_add_a_comment_to_close_the_room"}}</div>
						</div>
						{{/if}}
					</div>
					<div class="rc-input {{#if invalidTags}}rc-input--error{{/if}}">
						{{#if hasAvailableTags}}
						<div class="rc-form-group rc-form-group--small rc-form-group--inline">
							<select id="tagSelect" class="rc-input rc-input--small rc-form-item-inline">
								<option value="placeholder" disabled selected>{{_ "Select_tag"}}</option>
								{{#each availableUserTags}}
									<option value="{{_id}}">{{this}}</option>
								{{/each}}
							</select>
							<button id="addTag" class="rc-button rc-button--primary rc-form-item-inline"><i class="icon-plus"></i></button>
						</div>
						{{else}}
						<label class="rc-input__label">
							<div class="rc-input__wrapper">
								<div class="rc-input__icon">
									{{> icon icon='edit' }}
								</div>
								<input id="tagInput" class="rc-input__element" type="text" name="tags" autocomplete="off" placeholder="{{tagsPlaceHolder}}">
							</div>
						</label>
						{{/if}}
						{{#if invalidTags}}
						<div class="rc-input__error">
							<div class="rc-input__error-icon">
								{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
							</div>
							<div class="rc-input__error-message">{{_ "error-tags-must-be-assigned-before-closing-chat"}}</div>
						</div>
						{{/if}}
					</div>
					<div class="rc-form-group rc-form-group--small">
						<ul id="tags" class="chip-container current-room-tags">
							{{#each tags}}
							<li class="remove-tag" title="{{this}}">
								{{#if canRemoveTag availableUserTags this}}
									<i class="icon icon-cancel-circled"></i>
								{{/if}}
								{{this}}
							</li>
							{{/each}}
						</ul>
					</div>
				</div>
			</form>
			<div class="rc-input">
				<button form="close-room" class="rc-button rc-button--primary js-close-room">{{_ " Confirm "}}</button>
			</div>
		</div>
	</section>
</template>
